package com.itheima.test4;

import java.util.ArrayList;

public class test2 {
    public static void main(String[] args) {
        ArrayList<Teacher> list=new ArrayList<>();
        Teacher te1=new Teacher("赵老师","javase");
        Teacher te2=new Teacher("钱老师","javaee");
        Teacher te3=new Teacher("孙老师","php");
        Teacher te4=new Teacher("李老师","python");
        list.add(te1);
        list.add(te2);
        list.add(te3);
        list.add(te4);
        for (int i = 0; i < list.size(); i++) {
            Teacher te=list.get(i);
            System.out.println("姓名："+te.getName()+",专业："+te.getMajor());
        }
    }
}
